/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package Dao;

import Interface.InterfaceClientFL;
import Pojo.ClientFl;
import java.util.List;
import org.hibernate.Query;
import org.hibernate.Session;

/**
 *
 * @author olegk
 */
public class DaoClientFL implements InterfaceClientFL{

    @Override
    public boolean register(Session session, ClientFl clientFL) throws Exception {
        session.save(clientFL);
        return true;
    }

    @Override
    public boolean update(Session session, ClientFl clientFL) throws Exception {
        session.update(clientFL);
        return true;
    }

    @Override
    public boolean delete(Session session, ClientFl clientFL) throws Exception {
        session.delete(clientFL);
        return true;
    }

    @Override
    public List<ClientFl> getAll(Session session) throws Exception {
        String hql="from ClientFl";
        Query query=session.createQuery(hql);        
        List<ClientFl> listClientFL =(List<ClientFl>) query.list();        
        return listClientFL;
    }

        
}
